﻿@model MvcApplication.Models.HopDongModel

@{
    ViewBag.Title = "Thêm mới hợp đồng";
}

<h2>Thêm mới hợp đồng</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

    @Html.DropDownList("selectedPhongBan", (IEnumerable<SelectListItem>)ViewBag.phong_ban, new { disabled = "true" })
    @Html.DropDownList("selectedNhanSu", (IEnumerable<SelectListItem>)ViewBag.nhan_su, new { disabled = "true" })
@using (Html.BeginForm("CreateSubmit", "HopDong"))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Hợp đồng</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.so_hop_dong, "Số hợp đồng")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.so_hop_dong)
            @Html.ValidationMessageFor(model => model.so_hop_dong)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ly_do_hop_dong, "Lý do")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ly_do_hop_dong)
            @Html.ValidationMessageFor(model => model.ly_do_hop_dong)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ngay_ky, "Ngày ký")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.ngay_ky, new { @class = "needDatePicker" })
            @Html.ValidationMessageFor(model => model.ngay_ky)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ngay_bat_dau, "Ngày bắt đầu")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.ngay_bat_dau, new { @class = "needDatePicker" })
            @Html.ValidationMessageFor(model => model.ngay_bat_dau)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ngay_ket_thuc, "Ngày kết thúc")
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.ngay_ket_thuc, new { @class = "needDatePicker" })
            @Html.ValidationMessageFor(model => model.ngay_ket_thuc)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.muc_luong_thoi_diem_ky, "Mức lương thời điểm ký")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.muc_luong_thoi_diem_ky)
            @Html.ValidationMessageFor(model => model.muc_luong_thoi_diem_ky)
        </div>
        @Html.Hidden("id_nhan_su", (int)ViewBag.selectedNhanSu)
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Trở lại danh sách", "Index", new
{
    selectedPhongBan = ViewBag.selectedPhongBan,
    selectedNhanSu = ViewBag.selectedNhanSu
})
</div>
